package top.songxs.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import top.songxs.entity.Dict;
import top.songxs.result.Result;
import top.songxs.service.DictService;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/dict")
public class DictController { //not extends BaseController 因为查询条件已经封装houseQueryVo中


    @Reference
    private DictService dictService;
    @RequestMapping("/findListByDictCode/{dictCode}")
    public Result findListByDictCode(@PathVariable String dictCode){
        //获取指定的字典项列表
        List<Dict> areaList123 = this.dictService.findListByDictCode(dictCode);
        return Result.ok(areaList123);
    }
    @RequestMapping("/findListByParentId/{parentId}")
    public Result findListByParentId(@PathVariable Long parentId){
        List<Dict> plateList = this.dictService.findListByParentId(parentId);
        return Result.ok(plateList);
    }
}
